<div class="form-group">
    <label>标题</label>
    <input type="text" name="title" class="form-control"
           value="{{old('title',$slider['title']??'')}}">
</div>

<div class="form-group">
    <label>跳转链接</label>
    <input type="text" name="url" class="form-control"
           value="{{old('url',$slider['url']??'http://')}}">
</div>
<div class="form-group">
    <label>图片</label>
    <div class="input-group mb-1">
        <input class="form-control" name="image" readonly="" value="{{old('image',$slider['image']??'')}}">
        <div class="input-group-append">
            <button onclick="upImagePc(this)" class="btn btn-secondary" type="button">单图上传</button>
        </div>
    </div>
    <div style="display: inline-block;position: relative;">
        <img src="{{old('image',$slider['image']??asset('images/nopic.jpg'))}}" class="img-responsive img-thumbnail" width="150">
    </div>
    <script>
        //上传图片
        function upImagePc() {
            require(['hdjs'], function (hdjs) {
                hdjs.image(function (images) {
                    $("[name='image']").val(images[0]);
                    $(".img-thumbnail").attr('src', images[0]);
                })
            });
        }
    </script>
</div>
